package com.jeff.tianti.cms.dao;

import com.jeff.tianti.cms.entity.ColumnInfo;
import com.jeff.tianti.common.dao.CommonDao;
import org.springframework.data.jpa.repository.Query;

import java.util.Dictionary;
import java.util.List;

/**
 * @author xujianfang
 * @desc ColumnInfoDao接口 
 * @date 2017-03-16
 */
public interface ColumnInfoDao extends ColumnInfoDaoCustom,CommonDao<ColumnInfo,String>{
    @Query("from ColumnInfo d where d.code = ?1 and d.id <> ?2 and d.deleteFlag=0 ")
    List<ColumnInfo> findByCodeAndId(String code, String id);

    @Query("from ColumnInfo d where d.code = ?1  and d.deleteFlag=0 ")
    List<ColumnInfo> findByCode(String code);

    @Query("from ColumnInfo d where d.deleteFlag=0 ")
    List<ColumnInfo> findAllNoDel();
}